<?php
# http://projects:8081/cdapp-2kt-api/api/planner_params_get.php
include_once '_portal.php';

// $input = $post->input;

$zuuu = get_param('AMAN.Scheme.ZUUU');
$zutf = get_param('AMAN.Scheme.ZUTF');
$zutf_single = get_param('AMAN.Scheme.ZUTF.Single');

if ($zutf == null) {
  $zutf = json_parse(file_get_contents('./planner_params_aman_scheme_zutf.json'));
  save_param('AMAN.Scheme.ZUTF', $zutf);
}

if ($zuuu == null) {
  $zuuu = json_parse(file_get_contents('./planner_params_aman_scheme_zuuu.json'));
  save_param('AMAN.Scheme.ZUUU', $zuuu);
}

if ($zutf_single == null) {
  $zutf_single = json_parse(file_get_contents('./planner_params_aman_scheme_zutf_single.json'));
  save_param('AMAN.Scheme.ZUTF.Single', $zutf_single);
}

output([
  'time' => date('Y-m-d H:i:s'),
  'AMAN' => [
    'ZUTF' => $zutf,
    'ZUUU' => $zuuu,
    'ZUTFSingle' => $zutf_single,
  ],
]);